<?php
/**
 * @ClassName: Amaptest
 * @Description: TODO
 * @author: wmsh
 * @Date: 2024-05-29 15:18
 * @Version: V1.0.0
 */

namespace app\test\controller\test;

use think\Controller;

class Amaptest extends Controller
{
    protected $noNeedLogin = ['*'];

    public function index()
    {
        var_dump("高德地图");
        var_dump(amap());
        $format_address = amap()->geo('云南省昆明市五华区金鼎科技园18号平台A座101');
        var_dump('地理编码：' . $format_address);
        $res = amap()->regeo('102.684696,25.071126');
        var_dump('逆地理编码：' . $res);
        $res1 = amap()->walking('102.684696,25.071126', '102.752581,25.0841');
        var_dump('步行路径规划：' . $res1);
        $res2 = amap()->bus('102.684696,25.071126', '102.752581,25.0841', '昆明市');
        var_dump('公交路径规划：' . $res2);
        $res3 = amap()->drive('102.684696,25.071126', '102.752581,25.0841');
        var_dump('驾车路径规划：' . $res3);
        $res4 = amap()->bicycling('102.684696,25.071126', '102.752581,25.0841');
        var_dump('骑行路径规划：' . $res4);
        $res5 = amap()->distance('102.684696,25.071126', '102.752581,25.0841', 0);
        var_dump('直线距离：' . $res5);
        $res6 = amap()->distance('102.684696,25.071126', '102.752581,25.0841');
        var_dump('驾车导航距离：' . $res6);
        $res7 = amap()->distance('102.684696,25.071126', '102.752581,25.0841', 2);
        var_dump('公交规划距离：' . $res7);
        $res8 = amap()->distance('102.730096,25.074642', '102.752581,25.0841', 3);
        var_dump('步行规划距离：' . $res8);
        $res9 = amap()->ip('116.54.105.141');
        var_dump('IP定位：' . $res9);
        $res10 = amap()->weather('116.54.105.141');
        var_dump('实况天气：' . $res10);
        $res11 = amap()->weather('116.54.105.141', 'all');
        var_dump('预报天气：' . $res11);
    }

}